package com.moorror.codegenvel.common.table;

import lombok.Data;

/**
 * @Author jiyanghuang
 * @Date 2025/8/27 21:05
 */
@Data
public class TreeLineUpdateContext<T extends TreeLineObject> {

    /**
     * 更新前的对象
     */
    private T oldObj;

    /**
     * 更新后的对象
     */
    private T newObj;

    /**
     * 当前更新的列
     */
    private ColumnDesc columnDesc;

    public static <T extends TreeLineObject> TreeLineUpdateContext of(T oldObj, T newObj, ColumnDesc columnDesc) {
        TreeLineUpdateContext context = new TreeLineUpdateContext(oldObj, newObj, columnDesc);
        return context;
    }

    public TreeLineUpdateContext() {
    }

    public TreeLineUpdateContext(T oldObj, T newObj, ColumnDesc columnDesc) {
        this.oldObj = oldObj;
        this.newObj = newObj;
        this.columnDesc = columnDesc;
    }
}
